/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.IntermediateActions;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.BasicActions.InputPin;

import edu.pku.sei.modeler.model.uml.FundamentalActivities.Action;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class DestroyObjectAction extends Action implements IDestroyObjectAction {
	// attributes
	
	protected boolean isDestroyLinks;
	
	protected boolean isDestroyOwnedObjects;
	
	protected InputPin target;
	
	
	
	
	// references
	
	
	
	// getters & setters for attributes
	
	@MethodProperty(
			id = "DESTROYOBJECTACTION_ISDESTROYLINKS",
			catalog = "Model",
			name = ModelPackage.DESTROYOBJECTACTION_ISDESTROYLINKS,
			setter = "setisDestroyLinks"
			)
	
	public boolean getIsDestroyLinks() {
		return isDestroyLinks;
	}
	public void setIsDestroyLinks(boolean newIsDestroyLinks) {
		boolean oldisDestroyLinks = isDestroyLinks;
		isDestroyLinks = newIsDestroyLinks;
		firePropertyChange(ModelPackage.DESTROYOBJECTACTION_ISDESTROYLINKS, oldisDestroyLinks, newIsDestroyLinks);
	}
	
	@MethodProperty(
			id = "DESTROYOBJECTACTION_ISDESTROYOWNEDOBJECTS",
			catalog = "Model",
			name = ModelPackage.DESTROYOBJECTACTION_ISDESTROYOWNEDOBJECTS,
			setter = "setisDestroyOwnedObjects"
			)
	
	public boolean getIsDestroyOwnedObjects() {
		return isDestroyOwnedObjects;
	}
	public void setIsDestroyOwnedObjects(boolean newIsDestroyOwnedObjects) {
		boolean oldisDestroyOwnedObjects = isDestroyOwnedObjects;
		isDestroyOwnedObjects = newIsDestroyOwnedObjects;
		firePropertyChange(ModelPackage.DESTROYOBJECTACTION_ISDESTROYOWNEDOBJECTS, oldisDestroyOwnedObjects, newIsDestroyOwnedObjects);
	}
	
	public InputPin getTarget() {
		return target;
	}
	public void setTarget(InputPin newTarget) {
		InputPin oldtarget = target;
		target = newTarget;
		firePropertyChange(ModelPackage.DESTROYOBJECTACTION_TARGET, oldtarget, newTarget);
	}
	
	// getters for references
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.DESTROYOBJECTACTION_ISDESTROYLINKS, isDestroyLinks);
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.DESTROYOBJECTACTION_ISDESTROYOWNEDOBJECTS, isDestroyOwnedObjects);
		
		XMLUtility.xmlInstance.serializeNode(root, ModelPackage.DESTROYOBJECTACTION_TARGET, target);
		
		// references
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		isDestroyLinks = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.DESTROYOBJECTACTION_ISDESTROYLINKS);
		
		isDestroyOwnedObjects = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.DESTROYOBJECTACTION_ISDESTROYOWNEDOBJECTS);
		
		target = (InputPin)XMLUtility.xmlInstance.deSerializeNode(root, ModelPackage.DESTROYOBJECTACTION_TARGET, this);
		
		// references
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		else if(ModelPackage.DESTROYOBJECTACTION_TARGET.equals(featureID)) {
			target = (InputPin)value;
		}
		
		// references
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 